﻿@{
    ViewBag.Title = "Form"; 
    Layout = "~/Views/Shared/_Form.cshtml";
}
<script>
    layui.use(['jquery', 'form', 'common','optimizeSelectOption'], function () {
        var form = layui.form,
            $ = layui.$,
            common = layui.common;
        var keyValue = $.request("keyValue");
        //权限字段
        common.authorizeFields('adminform');

        $(function () {
            if (!!keyValue) {
                 common.ajax({
                   url: '/ProcessManage/ProcessFlow/GetFormJson',
                   dataType: 'json',
                   data: { keyValue: keyValue },
                   async: false,
                   success: function (data) {
                       common.val('adminform', data);
                    }
               });
            }
           form.render();
       });
       wcLoading.close();
       //监听提交
       form.on('submit(saveBtn)', function (data) {
           var postData = data.field;
           if (!postData["F_EnabledMark"]) postData["F_EnabledMark"] = false;
           common.submitForm({
               url: '/ProcessManage/ProcessFlow/SubmitForm?keyValue=' + keyValue,
               param: postData,
               success: function () {
                   common.parentreload('data-search-btn');
               }
           })
           return false;
       });
   });
</script>

<body>
    <div class="layuimini-container">
        <div class="layuimini-main">
            <div class="layui-form layuimini-form" lay-filter="adminform">
                <div class="layui-form-item layui-hide">
                    <label class="layui-form-label required">工序名称</label>
                    <div class="layui-input-block">
                        <input type="text" id="F_ProcessFlowName" name="F_ProcessFlowName" autocomplete="off" maxlength="50" lay-verify="required" placeholder="请输入工序名称" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item layui-hide">
                    <label class="layui-form-label">选项</label>
                    <div class="layui-input-block">
                        <input type="checkbox" name="F_EnabledMark" id="F_EnabledMark" checked="" value="true" title="有效标识">
                    </div>
                </div>
                <div class="layui-form-item layui-form-text layui-hide">
                    <label class="layui-form-label required">工序说明</label>
                    <div class="layui-input-block">
                        <textarea id="F_Description" name="F_Description" lay-verify="required" class="layui-textarea" placeholder="请输入工序说明"></textarea>
                    </div>
                </div>
                <div class="layui-form-item layui-hide">
                    <button class="layui-btn site-demo-active" lay-submit id="submit" lay-filter="saveBtn">确认保存</button>
                </div>
            </div>
        </div>
    </div>
</body>

